Formius.Element_Container_Form = $.inherit(Formius.Element_Container, {
	settings: {},
	__constructor: function(element, settings) {
		settings = Formius.Helper.extend(Formius.settings, settings);
		this.__base(element, this, settings);
		
		var self = this;
		this.element.submit(function(event) {
			if (!self.validate()) {
				self.showMessage();
				event.preventDefault();
				return false;
			}
			return true;
		});
		this.getElement().bind('submit', {element: this}, function(e) {
			if (e.data.element) {
				e.data.element.trigger(e.data.element.__self.EVENT_SUBMIT);
			}
		});
		this.init();
		/*this.bind('change', function() {
			this.validate();
			this.showMessage();
		});*/
	},
	getContainerSelector: function() {
		var selectors = this.getForm().getSettings().selectors;
		return selectors.form || selectors.container || selectors.field;
	},
	getErrorTemplate: function() {
		return this.getForm().getSettings().errors.form;
	},
	getSettings: function() {
		return this.settings;
	},
	init: function() {
		this.getElement().addClass(this.settings.classes.init);
		return this;
	},
	isForm: function() {
		return true;
	}
}, {
	EVENT_SUBMIT: 'submit'
});